package com.gitee.srurl.core.dto;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author zxw
 * @date 2023/4/19 22:51
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DataModel {

    /**
     * 原始
     */
    private String originUrl;

    /**
     * 短网址key
     */
    private String shortKey;

    /**
     * 短链地址
     */
    private String shortUrl;

    /**
     * 使用次数
     */
    private Long times;

    /**
     * 到期时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime expireTime;

    /**
     * 短网址使用的域名
     */
    private String domain;

    /**
     * 更新访问次数 默认为true更新
     */
    private Boolean updateTimes;
}
